import request from '@/config/axios'

// 项目原始需求 VO
export interface ProjectOriginalVO {
  id: number // 编号
  name: string // 需求名称
  projectId: number // 项目id
  remark: string // 备注
  context: string // 需求内容
}

// 项目原始需求 API
export const ProjectOriginalApi = {
  // 查询项目原始需求分页
  getProjectOriginalPage: async (params: any) => {
    return await request.get({ url: `/agent/project-original/page`, params })
  },

  // 查询项目原始需求详情
  getProjectOriginal: async (id: number) => {
    return await request.get({ url: `/agent/project-original/get?id=` + id })
  },

  // 新增项目原始需求
  createProjectOriginal: async (data: ProjectOriginalVO) => {
    return await request.post({ url: `/agent/project-original/create`, data })
  },

  // 修改项目原始需求
  updateProjectOriginal: async (data: ProjectOriginalVO) => {
    return await request.put({ url: `/agent/project-original/update`, data })
  },

  // 删除项目原始需求
  deleteProjectOriginal: async (id: number) => {
    return await request.delete({ url: `/agent/project-original/delete?id=` + id })
  },

  // 导出项目原始需求 Excel
  exportProjectOriginal: async (params) => {
    return await request.download({ url: `/agent/project-original/export-excel`, params })
  },
  
  // 分解原始需求
  decomposeRequirement: async (id: number) => {
    return await request.post({ url: `/agent/project-original/decompose-requirement?id=` + id })
  },
}
